<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<SCRIPT LANGUAGE="JavaScript">
<!--
	if(window.top.$("#current_pos").data('clicknum')==1 || window.top.$("#current_pos").data('clicknum')==null) {
	parent.document.getElementById('display_center_id').style.display='';
	parent.document.getElementById('center_frame').src = '?m=content&c=content&a=public_categorys&type=add&menuid=<?php echo $_GET['menuid'];?>&pc_hash=<?php echo $_SESSION['pc_hash'];?>';
	window.top.$("#current_pos").data('clicknum',0);
}
//-->
</SCRIPT>
<script>
    function change_color_over(title_id){
    	$("#"+title_id).css('color',"blue");
    }
    function change_color_out(title_id){
    	$("#"+title_id).css('color',"black");
    }
</script>
<!-- <h3 style="padding-left: 20px;padding-top: 10px">
	<?=$data['catname']?>——全部资源
	<a href="?m=admin&c=category&a=init&module=admin" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
</h3> -->

<div class="subnav">
	<div class="content-menu ib-a blue line-x">
		<a href="?m=admin&c=resources&a=init&catid=<?=$catid?>" class="on"><em>全部</em></a>
		<span>|</span>
		<a href="?m=admin&c=resources&a=index&source_type=1&catid=<?=$catid?>" ><em>资讯</em></a>
		<span>|</span>
		<a href="?m=admin&c=resources&a=index&source_type=2&catid=<?=$catid?>" ><em>视频</em></a>
		<span>|</span>
		<a href="?m=admin&c=resources&a=index&source_type=3&catid=<?=$catid?>" ><em>图集</em></a>
		<span>|</span>
		<a href="?m=admin&c=resources&a=tIndex&catid=<?=$catid?>" ><em>人才</em></a>
		<span>|</span>
		<a href="?m=admin&c=resources&a=cIndex&catid=<?=$catid?>" ><em>课程</em></a>
		<!-- <span>|</span>
		<a href="javascript:;" onclick="refreshDataCate(<?=$catid?>);"><em title='用来刷新当前栏目上的信息！'>刷新当前栏目缓存</em></a> -->
		<span>|</span>
		<a href="javascript:;" onclick="refreshData(1);"><em title='用来刷新所有栏目上的信息！'>刷新栏目缓存</em></a>

	</div>
</div>

<div class="pad-lr-10">

	<form name="myform" id="myform" action="" method="post" >
		<div class="table-list">
			<table width="100%">
				<thead>
				<tr>
					<th width="16"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
					<th width="57"><?php echo L('listorder');?></th>
					<th width="60">ID</th>
					<th><?php echo L('title');?></th>
					<th><?php echo L('information_image_cover');?></th>
					<th><?php echo L('type')?></th>
					<th width="168"><?php echo "发布时间";?></th>
					<th width="200"><?php echo L('operations_manage');?></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if(!empty($list)) {

					foreach ($list as $k=> $r) {
						?>
						<tr>
							<td align="center"><input class="inputcheckbox " name="ids[]" value="<?php echo $r['id'];?>" type="checkbox"></td>
							<td align='center'><input name='listorders[<?php echo $r['id'];?>]' type='text' size='3' value='<?php echo $r['sort'];?>' class='input-text-c'></td>
							<td align='center' ><?php echo $r['source_id'];?></td>
							<td align='center' >
								<?php if ($r['source_type'] == 1) {?>
								<a href="http://m.nsr.com.cn/xinsilu/v1/webPage/showNewsNsrHtml/<?=$r['source_id']?>?from=timeline"   id="title_<?php echo $r['source_id'];?>" target="_blank"  onmouseover="change_color_over('title_'+<?php echo $r['source_id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['source_id'];?>)" title="点击可预览：<?php echo $r['title'];?>资讯"><?php echo str_cut($r['title'],120);?></a>
								<?php }else if($r['source_type'] == 2){ ?>
								<a href="/index.php?m=contest&c=index&a=videoshow&id=<?php echo $r['source_id']?>"    id="title_<?php echo $r['source_id'];?>" target="_blank"  onmouseover="change_color_over('title_'+<?php echo $r['source_id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['source_id'];?>)" title="点击可预览：<?php echo $r['title'];?>视频"><?php echo str_cut($r['title'],120);?></a>
								<?php }else if($r['source_type'] == 3){?>
								<a href="http://m.nsr.com.cn/xinsilu/v1/pictureNsr/showOneHtml/<?=$r['source_id']?>"    id="title_<?php echo $r['source_id'];?>" target="_blank"  onmouseover="change_color_over('title_'+<?php echo $r['source_id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['source_id'];?>)" title="点击可预览：<?php echo $r['title'];?>图集"><?php echo str_cut($r['title'],120);?></a>
								<?php } else {?>
								<?php echo str_cut($r['title'],120);?>
								<?php }?>
							</td>
							<td align='center' ><?php if($r['image_cover']){ ?><img src="<?php echo $r['image_cover'];?>" height="60" /><?php }else{ echo '<font color="red">（未设置）</font>';}?></td>
							<td align='center' ><?php echo $r['typeName'];?></td>
							<td align='center'><?php echo substr($r['publish_time'],0,10);?></td>
							<td align='center'><a href="?m=admin&c=resources&a=del&id=<?php echo $r['id']?>" onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($r['title'])))?>')"><?php echo L('deletebind')?></a></td>

						</tr>
					<?php }
				} else {
					echo "<tr><td colspan='6' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
				}
				?>
				</tbody>
			</table>
			<div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label>
				<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
				<input type="button" class="button" value="<?php echo L('listorder');?>" onclick="myform.action='?m=admin&c=resources&a=listorder&dosubmit=1&steps=<?php echo $steps;?>';myform.submit();"/>
				<input type="button" class="button" value="<?php echo L('deletebind');?>" onclick="myform.action='?m=admin&c=resources&a=deleteAll&dosubmit=1&steps=<?php echo $steps;?>';return confirm_delete()"/>
			</div>
			<div id="pages"><?php echo $pages;?></div>
		</div>
	</form>
</div>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<script type="text/javascript">

	function confirm_delete(){
		if(confirm('<?php echo L('confirm_delete', array('message' => L('selected')));?>')) $('#myform').submit();
	}
</script>
</body>
</html>